/***************************************************************************
 创建者：华磊
 开始时间：         : 2020.11.16
 copyright            : (C) 深圳市华友高科有限公司
 修改说明：（每次有修改就添加一条，带有 修改人，修改时间，修改描述）

 2017.05.04 华磊 添加视觉指令 视觉保存视觉修改
 2017.05.05 华磊 添加冲压指令 ; 视觉正则匹配check

 ***************************************************************************
 *   程序指令主视窗
 *                                                                         *
 ***************************************************************************/
#ifndef PROGRAMVIEW_H
#define PROGRAMVIEW_H
#include "programview_global.h"
#include <QDialog>
#include <QTranslator>
#include "instructionmenu.h"
#include "instructionmenusecond.h"
#include "instructionall.h"
#include "movemenu.h"
#include "palletmenu.h"
#include "flowmenu.h"
#include "registermenu.h"
#include "iomenu.h"
#include "othermenu.h"
#include "stampmenu.h"
#include "pointviewdialog.h"
#include "othernextpagemenu.h"
#include "weldmenu.h"
#include "guidanceMenu.h"
#include "modbusmenu.h"
#include "tcpcommunicationmenu.h"
#include "programsavedialog.h"
#include "lasercameramenu.h"


#include "../instruction/MotionInstructionView/motioninstructionview.h"
#include "../instruction/MotionInstructionDelegate/motioninstructiondelegate.h"
#include "../instruction/IfInstructionView/ifinstructionview.h"
#include "../instruction/IfInstructionDelegate/ifinstructiondelegate.h"
#include "../instruction/LabelJmpView/labeljmpview.h"
#include "../instruction/LabelJmpView/progromlistview.h"
#include "../instruction/LabelJmpDelegate/labeljmpdelegate.h"
#include "../instruction/WaitInstructionView/waitinstructionview.h"
#include "../instruction/WaitInstructionDelegate/waitinstructiondelegate.h"
#include "../instruction/ForInstructionView/forinstructionview.h"
#include "../instruction/ForInstructionDelegate/forinstructiondelegate.h"
#include "../instruction/RegisterInstructionView/registerinstructionview.h"
#include "../instruction/RegisterInstructionDelegate/registerinstructiondelegate.h"
#include "../instruction/SelectInstructionView/selectinstructionview.h"
#include "../instruction/SelectInstructionDelegate/selectinstructiondelegate.h"
#include "../instruction/SkipConditionView/skipconditionview.h"
#include "../instruction/SkipConditionDelegate/skipconditiondelegate.h"
#include "../instruction/OutputInstructionView/outputinstructionview.h"
#include "../instruction/OutputInstructionDelegate/outputinstructiondelegate.h"
#include "../instruction/CoordinateInstructionView/coordinateinstructionview.h"
#include "../instruction/CoordinateInstructionDelegate/coordinateinstructiondelegate.h"
#include "../instruction/OtherInstructionView/otherinstructionview.h"
#include "../instruction/OtherInstructionDelegate/otherinstructiondelegate.h"
#include "../instruction/PalletInstructionView/palletinstructionview.h"
#include "../instruction/PalletInstructionDelegate/palletinstructiondelegate.h"
#include "../instruction/VisionInstructionView/visioninstructionview.h"
#include "../instruction/VisionInstructionDelegate/visioninstructiondelegate.h"
#include "../instruction/MoveMagInstructionView/movemaginstructionview.h"
#include "../instruction/MoveMagInstructionDelegate/movemaginstructiondelegate.h"
#include "../instruction/MoveFreeInstructionDelegate/movefreeinstructiondelegate.h"
#include "../instruction/MoveFreeInstructionView/movefreeinstructionview.h"
#include "../instruction/MoveFreeInstructionView/movefreevmarksettingview.h"
#include "../instruction/ModbusReadInstructionView/modbusreadinstructionview.h"
#include "../instruction/ModbusReadInstructionDelegate/modbusreadinstructiondelegate.h"
#include "../instruction/ModbusStartInstructionView/modbusstartinstructionview.h"
#include "../instruction/ModbusStartInstructionDelegate/modbusstartinstructiondelegate.h"
#include "../instruction/ModbusWriteInstructionView/modbuswriteinstructionview.h"
#include "../instruction/ModbusWriteInstructionDelegate/modbuswriteinstructiondelegate.h"
#include "../instruction/OdometryInstructionView/odometryinstructionview.h"
#include "../instruction/OdometryInstructionDelegate/odometryinstructiondelegate.h"
#include "../instruction/TCPStartInstructionView/tcpstartinstructionview.h"
#include "../instruction/TCPStartInstructionDelegate/tcpstartinstructiondelegate.h"
#include "../instruction/TCPReadInstructionView/tcpreadinstructionview.h"
#include "../instruction/TCPReadInstructionDelegate/tcpreadinstructiondelegate.h"
#include "../instruction/TCPWriteInstructionView/tcpwriteinstructionview.h"
#include "../instruction/TCPWriteInstructionDelegate/tcpwriteinstructiondelegate.h"
#include "../instruction/MusicInstructionView/musicinstructionview.h"
#include "../instruction/MusicInstructionDelegate/musicinstructiondelegate.h"
#include "../instruction/ChargingInstructionView/charginginstructionview.h"
#include "../instruction/ChargingInstructionDelegate/charginginstructiondelegate.h"
#include "../instruction/LiftMechanismInstructionView/liftmechanisminstructionview.h"
#include "../instruction/LiftMechanismInstructionDelegate/liftmechanisminstructiondelegate.h"
#include "../instruction/LoadMapInstructionView/loadmapinstructionview.h"
#include "../instruction/LoadMapInstructionDelegate/loadmapinstructiondelegate.h"
#include "../instruction/CheckBatteryView/checkbatteryview.h"
#include "../instruction/CheckBatteryDelegate/checkbatterydelegate.h"
#include "../instruction/WaitCommandView/waitcommandview.h"
#include "../instruction/WaitCommandDelegate/waitcommanddelegate.h"

// 机械手控制指令
#include "../instruction/RobotMoveInstructionView/robotmoveinstructionview.h"
#include "../instruction/RobotMoveInstructionDelegate/robotmoveinstructiondelegate.h"

// 滚筒机构指令
#include "../instruction/RollerInstructionView/rollerinstructionview.h"
#include "../instruction/RollerInstructionDelegate/rollerinstructiondelegate.h"

#include "../instruction/AxisMoveInstructionDelegate/axismoveinstructiondelegate.h"
#include "../instruction/AxisMoveInstructionView/axismoveinstructionview.h"
//拓展新指令增加代码20191122hualei
#include "../ExtensitionInstruction/WeldStartInstructionView/weldstartinstructionview.h"
//新指令20191130 ZHUHT
#include "../ExtensitionInstruction/WeldEndInstructionView/weldendinstructionview.h"
#include "../ExtensitionInstruction/WeaveInstructionView/weaveinstructionview.h"
#include "../ExtensitionInstruction/WeaveEndInstructionView/weaveendinstructionview.h"
#include "../ExtensitionInstruction/TrackWeldTASTInstructionView/trackweldtastinstructionview.h"
#include "../ExtensitionInstruction/TrackWeldEndInstructionView/trackweldendinstructionview.h"
#include "../ExtensitionInstruction/WatchDIInstructionView/watchdiinstructionview.h"
#include "../ExtensitionInstruction/LaserCameraInstructionView/lasercameracontrolinsview.h"
#include "../ExtensitionInstruction/LaserCameraInstructionView/lasercamerafetchpointinsview.h"
#include "../ExtensitionInstruction/LaserCameraInstructionView/lasercameratrackinsview.h"
#include "../ExtensitionInstruction/LaserCameraInstructionView/buffermoveview.h"
#include <QTableWidgetItem>

class ButtonFunctionMap;

/**
 * @brief The EM_MENUINDEX enum　指令窗口视窗显示页码
 */
enum EM_MENUINDEX
{
    EM_MENUINDEX_INSTRUCTIONMENU_USUALY1 = 1,
    EM_MENUINDEX_INSTRUCTIONMENU_ALL = 2,
    EM_MENUINDEX_MOVEMENU = 3,
    EM_MENUINDEX_PALLETMENU = 4,
    EM_MENUINDEX_FLOWMENU = 5,
    EM_MENUINDEX_REGISTERMENU = 6,
    EM_MENUINDEX_IOMENU = 7,
    EM_MENUINDEX_OTHERMENU = 8,
    EM_MENUINDEX_STAMPINGMENU = 9,
    EM_MENUINDEX_GUIDANCEMENU = 10,
    EM_MENUINDEX_MODBUSMENU = 11,
    EM_MENUINDEX_TCPMENU = 12,
    EM_MENUINDEX_OTHERMENU_NEXT= 13,
    EM_MENUINDEX_INSTRUCTIONMENU_USUALY2= 14,
    EM_MENUINDEX_WELDMENU =15,
    EM_MENUINDEX_LASERCAMERA =16,
};

/**
 * @brief The EM_EDIT_INSTRUCTION enum　指令编辑界面编号
 */
enum EM_EDIT_INSTRUCTION
{
    EM_EDIT_INSTRUCTION_MOTION = 1,
    EM_EDIT_INSTRUCTION_IF = 2,
    EM_EDIT_INSTRUCTION_LBLJMP = 3,
    EM_EDIT_INSTRUCTION_WAIT = 4,
    EM_EDIT_INSTRUCTION_FOR = 5,
    EM_EDIT_INSTRUCTION_REGISTER = 6,
    EM_EDIT_INSTRUCTION_SELECT = 7,
    EM_EDIT_INSTRUCTION_SKIP = 8,
    EM_EDIT_INSTRUCTION_OUTPUT = 9,
    EM_EDIT_INSTRUCTION_COORDINATE = 10,
    EM_EDIT_INSTRUCTION_OTHER = 11,
    EM_EDIT_INSTRUCTION_PALLET = 12,
    EM_EDIT_INSTRUCTION_PALLET_MOTION = 13,
    EM_EDIT_INSTRUCTION_VISION = 14,//2017.05.04补充
    EM_EDIT_INSTRUCTION_END = 15,
    EM_EDIT_INSTRUCTION_MOVE_MAG = 16,
    EM_EDIT_INSTRUCTION_MOVE_FREE = 17,
    EM_EDIT_INSTRUCTION_MODBUS_START = 18,
    EM_EDIT_INSTRUCTION_MODBUS_READ = 19,
    EM_EDIT_INSTRUCTION_MODBUS_WRITE = 20,
    EM_EDIT_INSTRUCTION_SET_ODOM = 21,
    EM_EDIT_INSTRUCTION_TCP_START = 22,
    EM_EDIT_INSTRUCTION_TCP_READ = 23,
    EM_EDIT_INSTRUCTION_TCP_WRITE = 24,
    EM_EDIT_INSTRUCTION_MUSIC = 25,
    EM_EDIT_INSTRUCTION_CHARGING = 26,
    EM_EDIT_INSTRUCTION_LIFT = 27,
    EM_EDIT_INSTRUCTION_LOAD_MAP=28,
    EM_EDIT_INSTRUCTION_CHECK_BATTERY=29,
    EM_EDIT_INSTRUCTION_WAIT_COMMAND=30,
    EM_EDIT_INSTRUCTION_ROBOT_MOVE = 31,
    EM_EDIT_INSTRUCTION_ROLLER = 32,
    EM_EDIT_INSTRUCTION_AXIS_MOVE = 33,
    EM_EDIT_INSTRUCTION_WELD_START=34,//拓展新指令增加代码20191122hualei
    EM_EDIT_INSTRUCTION_WELD_END=35,//新指令20191130 ZHUHT
    EM_EDIT_INSTRUCTION_WEAVE=36,
    EM_EDIT_INSTRUCTION_WEAVE_END=37,
    EM_EDIT_INSTRUCTION_TRACKWELD_TAST=38,
    EM_EDIT_INSTRUCTION_TRACKWELD_END=39,
    EM_EDIT_INSTRUCTION_WATCHDI=40,
    EM_EDIT_INSTRUCTION_LASERCAMERA_CTRL=41,
    EM_EDIT_INSTRUCTION_LASERCAMERA_TRACK=42,
    EM_EDIT_INSTRUCTION_LASERCAMERA_FETCHP=43,
    EM_EDIT_INSTRUCTION_BUFFERMOVE=44,
};

namespace Ui {
class ProgramView;
}

class WeldPropertyDialog;
class WeldConditionDialog;
class ProgromListView;
class WeaveMotionConditionDialog;

/**
 * @brief The ProgramView class     主视窗类
 */
class  ProgramView :public QDialog
{

    Q_OBJECT

public:
    explicit ProgramView(int styleId, CommunicateNormalDelegate *communicateNormalDelegateIn,
                         GlobalData *globalDataIn,
                         MoveOperation *moveOperationIn, GlobalData *ioDataIn,
                         MapView *mapViewIn,QWidget *parent = 0);
    ~ProgramView();

    /**
     * @brief updateView            更新数据到控件上
     */
    void updateView(bool updateList,bool updateModel);
    void initialButtonText();

    /**
     * @brief getCurrentLineIndex   获取当前指令所在行号
     * @return
     */
    int getCurrentLineIndex();

    /**
     * @brief editInstructionViewShowOrHide 指令属性编辑界面显示或隐藏
     */
    void editInstructionViewShowOrHide();

    /**
     * @brief changeLanguage        更改语言
     * @param language              语言编号
     */
    void changeLanguage(int language);

    /**
     * @brief getCurrentSelectionInstruction        获取当前选中行内容
     * @return                                      选中行指令内容
     */
    QString& getCurrentSelectionInstruction();

    int readButtonConfigFunction(QString configPath,QMap<int,int> &usualButtonFunctionOut);

public:
    /**
     * @brief initFlag              判断当前是否初始化状态
     */
    bool initFlag ;
    /**
     * @brief fileInformation       文件指令内容
     */
    QStringList fileInformation;

    QStringList fileInformationChinese;

    /**
     * @brief fileName              文件名
     */
    QString fileName;

    /**
     * @brief currentLineIndex      当前文件指令行号
     */
    int currentLineIndex;

    /**
     * @brief currentLineInstruction    当前行指令内容
     */
    QString currentLineInstruction;

    /**
     * @brief menuViewShowFlag      指令窗口显示标识　0：隐藏　1：显示
     */
    int menuViewShowFlag;

    /**
     * @brief isSave                文件保存标识　0：未保存,需要保存　１：已保存
     */
    bool isProgramFileSaved;

//    /**
//     * @brief fileOpenFirst     文件是否刚打开(如果是刚打开的,就不会做 是否修改的判断)
//     */
//    bool fileOpenFirst;

    /**
     * @brief currentMenuIndex      当前显示的指令窗口页号
     */
    EM_MENUINDEX currentMenuIndex;

    /**
     * @brief menuBtnTitle          指令标题按钮文字
     */
    QString menuBtnTitle;

    /**
     * @brief hideOrShowBtnPicture  指令窗口显示与否按钮图片地址
     */
    QString hideOrShowBtnPicture;

    /**
     * @brief currentLanguage       编辑界面的语言
     */
    int editLanguage;

    /**
     * @brief instructionMenu       常用指令窗口指针
     */
    InstructionMenu *instructionMenu_usualyUsed1;//不要直接使用该对象进行显示和隐藏，应该使用StackedWidget->setCurrentIndex(nIndex)
    InstructionMenuSecond *instructionMenu_usualyUsed2;

    /**
     * @brief instructionAll        全部指令窗口指针
     */
    InstructionAll *instructionMenu_all;

    /**
     * @brief moveMenu              运动指令窗口指针
     */
    MoveMenu *moveMenu;

    /**
     * @brief palletMenu            码垛指令窗口指针
     */
    PalletMenu *palletMenu;

    /**
     * @brief flowMenu              流程指令窗口指针
     */
    FlowMenu *flowMenu;

    /**
     * @brief registerMenu          寄存器指令窗口指针
     */
    RegisterMenu *registerMenu;

    /**
     * @brief ioMenu                端口指令窗口指针
     */
    IoMenu *ioMenu;

    /**
     * @brief otherMenu             其它指令窗口指针
     */
    OtherMenu *otherMenu1;

    /**
     * @brief otherNextMenu         其他指令下一页窗口指令
     */
    OtherNextPageMenu *otherMenu2;

    /**
     * @brief stampMenu             冲压指令窗口指针
     */
    StampMenu *stampMenu;

    /**
     * @brief weldMenu             焊接指令窗口指针
     */
    WeldMenu *weldMenu;

    /**
     * @brief guidanceMenu          导航指令窗口指针
     */
    GuidanceMenu *guidanceMenu;

    /**
     * @brief modbusMenu            MODBUS总线指令窗口指针
     */
    ModbusMenu *modbusMenu;

    /**
     * @brief tcpCommunicationMenu   TCP以太网通信指令菜单视窗指针
     */
    TCPCommunicationMenu *tcpCommunicationMenu;
    LaserCameraMenu *laserCameraMenu;

    /**
     * @brief pointViewDialog       点查看窗口
     */
    PointViewDialog *pointViewDialog;

    /**
     * @brief programSaveDialog     修改 提示需要的保存窗口(弹出)
     */
    ProgramSaveDialog *programSaveDialog;

    /**
     * @brief instructionListFlag   当前指令列表显示标志　０：显示指令列表界面　１：指令属性编辑界面
     */
    int instructionListFlag;

    /**
     * @brief editInstructionBtnPicture 指令列表与指令属性按钮图片地址1
     */
    QString editInstructionBtnPicture1;
    /**
     * @brief editInstructionBtnPicture 指令列表与指令属性按钮图片地址2
     */
    QString editInstructionBtnPicture2;

    /**
     * @brief editInstructionViewIndex  各指令编辑界面编号
     */
    int editInstructionViewIndex;

    MotionInstructionView *motionInstructionView;
    MotionInstructionDelegate *motionInstructionDelegate;
    IfInstructionView *ifInstructionView;
    IfInstructionDelegate *ifInstructionDelegate;
    LabelJmpView *labelJmpView;
    ProgromListView *progromListView;
    LabelJmpDelegate *labelJmpDelegate;
    WaitInstructionView *waitInstructionView;
    WaitInstructionDelegate *waitInstructionDelegate;
    ForInstructionView *forInstructionView;
    ForInstructionDelegate *forInstructionDelegate;
    RegisterInstructionView *registerInstructionView;
    RegisterInstructionDelegate *registerInstructionDelegate;
    SelectInstructionView *selectInstructionView;
    SelectInstructionDelegate *selectInstructionDelegate;
    SkipConditionView *skipConditionView;
    SkipConditionDelegate *skipConditionDelegate;
    OutputInstructionView *outputInstructionView;
    OutputInstructionDelegate *outputInstructionDelegate;
    CoordinateInstructionView *coordinateInstructionView;
    CoordinateInstructionDelegate *coordinateInstructionDelegate;
    OtherInstructionView *otherInstructionView;
    OtherInstructionDelegate *otherInstructionDelegate;
    PalletInstructionView *palletInstructionView;
    PalletInstructionDelegate *palletInstructionDelegate;
    VisionInstructionView *visionInstructionView;
    VisionInstructionDelegate *visionInstructionDelegate;

    MoveMagInstructionDelegate *moveMagInstructionDelegate;
    MoveMagInstructionView *moveMagInstructionView;
    MoveFreeInstructionDelegate *moveFreeInstructionDelegate;
    MoveFreeInstructionView *moveFreeInstructionView;


    ModbusStartInstructionView *modbusStartInstructionView;
    ModbusStartInstructionDelegate *modbusStartInstructionDelegate;

    ModbusReadInstructionView *modbusReadInstructionView;
    ModbusReadInstructionDelegate *modbusReadInstructionDelegate;

    ModbusWriteInstructionView *modbusWriteInstructionView;
    ModbusWriteInstructionDelegate *modbusWriteInstructionDelegate;

    OdometryInstructionView *odometryInstructionView;
    OdometryInstructionDelegate *odometryInstructionDelegate;

    TCPStartInstructionView *tcpStartInstructionView;
    TCPStartInstructionDelegate *tcpStartInstructionDelegate;

    TCPReadInstructionView *tcpReadInstructionView;
    TCPReadInstructionDelegate *tcpReadInstructionDelegate;

    TCPWriteInstructionDelegate *tcpWriteInstructionDelegate;
    TCPWriteInstructionView *tcpWriteInstructionView;

    MusicInstructionView *musicInstructionView;
    MusicInstructionDelegate *musicInstructionDelegate;

    ChargingInstructionDelegate *chargingInstructionDelegate;
    ChargingInstructionView *chargingInstructionView;

    LiftMechanismInstructionDelegate *liftMechanismInstructionDelegate;
    LiftMechanismInstructionView *liftMechanismInstructionView;

    LoadMapInstructionView *loadMapInstructionView;
    LoadMapInstructionDelegate *loadMapInstructionDelegate;

    // ROBOT_MOVE　机械手控制指令
    RobotMoveInstructionView *robotMoveInstructionView;
    RobotMoveInstructionDelegate *robotMoveInstructionDelegate;

    CheckBatteryView *checkBatteryView;
    CheckBatteryDelegate *checkBatteryDelegate;

    WaitCommandView *waitCommandView;
    WaitCommandDelegate *waitCommandDelegate;

    // ROLLER 滚筒指令
    RollerInstructionView *rollerInstructionView;
    RollerInstructionDelegate *rollerInstructionDelegate;

    AxisMoveInstructionView *axisMoveInstructionView;
    AxisMoveInstructionDelegate *axisMoveInstructionDelegate;
    //拓展新指令增加代码20191122hualei
    WeldStartInstructionView *weldStartInsView;
    //新指令20191130 ZHUHT
    WeldEndInstructionView *weldEndInsView;
    WeaveInstructionView *weaveInsView;
    WeaveEndInstructionView *weaveEndInsView;
    TrackWeldTASTInstructionView *trackWeldTASTInsView;
    TrackWeldEndInstructionView *trackWeldEndInsView;
    WatchDIInstructionView *watchDIInsView;
    LaserCameraControlInsView *lasercameraControlInsView;
    LaserCameraTrackInsView *lasercameraTrackInsView;
    LaserCameraFetchPointInsView *lasercameraFetchPointInsView;
    BufferMoveView *bufferMoveView;

    WeldPropertyDialog *weldPropertyDialog;
    WeldConditionDialog *weldConditionDialog;
    WeaveMotionConditionDialog *weaveConditionDialog;

    GlobalData *ioData;
    ButtonFunctionMap *buttonFunMap;
private:
    QTranslator translator;



signals:
    /**
     * @brief moveUpInstruction 指令上移信号函数
     * @param lineIndex         指令所在行号
     * @return
     */
    void moveUpInstruction(int lineIndex);

    /**
     * @brief moveDownInstruction   指令下移信号函数
     * @param lineIndex             指令所在行号
     * @return
     */
    void moveDownInstruction(int lineIndex);

    /**
     * @brief deleteInstruction 删除指令信号函数
     * @param lineIndex         指令所在行号
     * @return
     */
    void deleteInstruction(int lineIndex);

    /**
     * @brief noteInstruction   注释指令信号函数
     * @param lineIndex         指令所在行号
     * @return
     */
    void noteInstruction(int lineIndex);

    /**
     * @brief recordPoint   载入点信号函数
     * @param lineIndex     指令所在行号
     * @return
     */
    int recordPoint(int lineIndex);

    /**
     * @brief showPoint     点查看信号函数
     * @param currentRow    当前行内容
     * @return
     */
    void showPoint(QString currentRow);

    /**
     * @brief jToPoint      关节到点信号函数
     * @param lineIndex     指令所在行号
     * @return
     */
    void jToPoint(int lineIndex);

    /**
     * @brief lToPoint      直线到点信号函数
     * @param lineIndex     指令所在行号
     * @return
     */
    void lToPoint(int lineIndex);


    void stopPointMove();

    /**
     * @brief saveFile          保存文件信号函数
     * @param fileName          文件名
     * @param fileInformation   文件指令列表
     * @return
     */
    //int saveFile(QString fileName, QStringList fileInformation);
    void saveFileSignal();

    /**
     * @brief menuViewShowOrHide        指令窗口显示或隐藏信号函数
     * @param menuViewShowFlag          指令窗口显示或隐藏标识
     */
    void menuViewShowOrHide(int menuViewShowFlag);

    /**
     * @brief menuChange                常用指令与全部指令窗口切换信号函数
     * @param currentMenuIndex          当前显示的指令窗口
     */
    //void menuChange(int currentMenuIndex);
    void menuChange();

    /**
     * @brief getCurrentLineInstruction 获取所选行的指令内容
     */
    void getCurrentLineInstruction(int currentLineIndex);

    /**
     * @brief openInstructionEditView   打开指令属性编辑界面
     */
    void openInstructionEditView();

    /**
     * @brief showFileInfoChineseSignal 调用翻译
     */
    void showFileInfoChineseSignal();

    /**
     * @brief recordDPointSignal            载入DP点位信号
     * @param currentLine
     */
    void recordDPointSignal(int currentLine);

    /**
     * @brief saveCurrentInstruction_Signal         点击指令列表按钮时更新保存当前编辑指令
     */
    void saveCurrentInstruction_Signal();

private slots:
    /**
     * @brief on_MoveUpBtn_clicked      指令上移响应槽函数
     */
    void on_MoveUpBtn_clicked();

    /**
     * @brief on_MoveDownBtn_clicked    指令下移响应槽函数
     */
    void on_MoveDownBtn_clicked();

    /**
     * @brief on_DelBtn_clicked         删除指令响应槽函数
     */
    void on_DelBtn_clicked();

    /**
     * @brief on_NoteBtn_clicked        注释指令响应槽函数
     */
    void on_NoteBtn_clicked();

    /**
     * @brief on_RecordPointBtn_clicked 载入点响应槽函数
     */
    void on_RecordPointBtn_clicked();

    /**
     * @brief on_ShowPointBtn_clicked   点查看响应槽函数
     */
    void on_ShowPointBtn_clicked();

    /**
     * @brief on_JToPointBtn_clicked    关节到点响应槽函数
     */
    void on_JToPointBtn_pressed();
    void on_JToPointBtn_released();

    /**
     * @brief on_LToPointBtn_clicked    直线到点响应槽函数
     */
    void on_LToPointBtn_pressed();
    void on_LToPointBtn_released();

    /**
     * @brief on_SaveBtn_clicked        保存文件响应槽函数
     */
    void on_SaveBtn_clicked();

    /**
     * @brief on_InstructionListBtn_clicked     指令列表响应槽函数
     */
    void on_InstructionListBtn_clicked();

    /**
     * @brief on_InstructionPropertyBtn_clicked     指令属性响应槽函数
     */
    void on_InstructionPropertyBtn_clicked();

    /**
     * @brief on_HideOrShow_AddCommand_Btn_clicked  指令窗口显示与否响应槽函数
     */
    void on_HideOrShow_AddCommand_Btn_clicked();

    /**
     * @brief on_Root_Mode_Btn_clicked              指令窗口标题响应槽函数
     */
    void on_Root_Mode_Btn_clicked();

    /**
     * @brief on_Command_tableWidget_doubleClicked  双击打开指令编辑界面槽函数
     * @param index                                 选中行
     */
    void on_Command_tableWidget_doubleClicked(const QModelIndex &index);

    void on_Command_tableWidget_clicked(const QModelIndex &index);

    void on_menu_stackedWidget_destroyed();

    // 单击选择当前指令响应槽函数
    void on_Command_tableWidget_itemClicked(QTableWidgetItem *item);

private:
    void initialDisplayStyle(int styleId);

private:
    Ui::ProgramView *ui;

    /**
     * @brief currentSeletionInstruction        当前选中行指令字符串
     */
    QString currentSeletionInstruction;
};

#endif // PROGRAMVIEW_H
